<template>
  <!-- vue3组件中的模板结构可以没有根标签div -->
  <div class="Son">
    <h3>我是Son组件（孙）{{ car.name }}--{{ car.price }}</h3>
  </div>
</template>

<script>
import { inject } from "vue";

export default {
  // eslint-disable-next-line vue/multi-word-component-names
  name: "Son",
  components: {},
  setup() {
    let car = inject("car");
    return { car };
  },
};
</script>

<style>
.Son {
  background-color: orange;
  padding: 10px;
}
</style>
